package interfaz;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.JButton;
import java.awt.Insets;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Info {

	private JFrame frmInfo;


	/**
	 * Create the application.
	 */
	public Info(String mensaje) {
		initialize(mensaje);
		frmInfo.setVisible(true);
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize(String mensaje) {
		frmInfo = new JFrame();
		frmInfo.setTitle("Info");
		frmInfo.setResizable(false);
		frmInfo.setBounds(100, 100, 450, 192);
		frmInfo.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0};
		gridBagLayout.rowHeights = new int[]{47, 0, 30, 30, 0, 0};
		gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		frmInfo.getContentPane().setLayout(gridBagLayout);
		
		JLabel lblMensaje = new JLabel("New label");
		GridBagConstraints gbc_lblMensaje = new GridBagConstraints();
		gbc_lblMensaje.insets = new Insets(0, 0, 5, 0);
		gbc_lblMensaje.gridx = 0;
		gbc_lblMensaje.gridy = 1;
		lblMensaje.setText(mensaje);
		frmInfo.getContentPane().add(lblMensaje, gbc_lblMensaje);
		
		JButton btnAceptar = new JButton("Aceptar");
		btnAceptar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				frmInfo.dispose();
			}
		});
		GridBagConstraints gbc_btnAceptar = new GridBagConstraints();
		gbc_btnAceptar.gridx = 0;
		gbc_btnAceptar.gridy = 4;
		frmInfo.getContentPane().add(btnAceptar, gbc_btnAceptar);
	}

}
